<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title></title>
    <link href="/asset/css/admin.css" rel="stylesheet" />
    <style id='panda-theme-color'></style>
</head>
<body class="theme-panda">
<div>
    <div class="layui-card">
        <div class="layui-card-body">
            <form class="layui-form toolbar">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <div class="layui-input-inline">
                            <input type="text" name="keywords" placeholder="请输入人员姓名/手机号等" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-input-inline">
                            <select name="status" id="status" lay-verify="" lay-search="" lay-filter="status"><option value="">【请选择状态】</option><option value="1">正常</option><option value="2">禁用</option></select><div class="layui-form-select"><div class="layui-select-title"><input type="text" placeholder="【请选择状态】" value="" class="layui-input"><i class="layui-edge"></i></div><dl class="layui-anim layui-anim-upbit"><dd lay-value="" class="layui-select-tips">【请选择状态】</dd><dd lay-value="1" class="">正常</dd><dd lay-value="2" class="">禁用</dd></dl></div>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-input-inline" style="width: auto;">
                            <button class="layui-btn layui-btn-primary layui-btn-sm" lay-submit="" lay-filter="searchForm" id="search"><i class="layui-icon">&#xe615;</i>搜索查询</button>
                            <a class="layui-btn layui-btn-danger layui-btn-sm btnBatchDrop" href="javascript:"  id="batchDrop" data-param="[]" lay-event="batchDrop"><i class="layui-icon layui-icon-delete"></i>批量删除</a>
                        </div>
                    </div>
                </div>
            </form>

            <table class="layui-hide" id="tableList" lay-filter="tableList"></table>

            <script type="text/html" id="toolBar">
                <a class="layui-btn layui-btn-xs btnEdit" lay-event="edit" title="编辑"><i class="layui-icon">&#xe630;</i>编辑</a>
                <a class="layui-btn layui-btn-danger layui-btn-xs btnDel" lay-event="del" title="删除"><i class="layui-icon">&#xe630;</i>删除</a>
            </script>

            <script type="text/html" id="statusTpl">
                <input type="checkbox" name="status" value="{{ d.id }}" lay-skin="switch" lay-text="正常|禁用" lay-filter="status" {{ d.status == 1 ? 'checked' : '' }} >
            </script>
        </div>
    </div>
</div>
<!-- 引入脚部 -->
<script src="/asset/layui/layui.js?v=1.0.0"></script>
<script src="/asset/js/common.js?v=1.0.0"></script>
<script type="text/javascript">
    layui.use(['func'], function () {
        //声明变量
        var func = layui.func;
        var cols = [
            {type: 'checkbox'}
            , {field: 'id', width: 80, title: 'ID', align: 'center'}
            , {field: 'nickname', width: 120, title: '昵称', align: 'center'}
            , {field: 'mobile', width: 130, title: '手机号码', align: 'center'}
            , {field: 'source', width: 80, title: '来源', align: 'center', templet(d) {
                    var cls = "", real = '小程序';
                    if (d.source == 1) {
                        cls = "layui-btn-normal";
                    } else if (d.source == 2) {
                        real= '公众号';cls = "layui-btn-danger";
                    } else if (d.source == 3) {
                        real = '注册';cls = "layui-btn-warm";
                    }
                    return '<span class="layui-btn ' + cls + ' layui-btn-xs">'+real+'</span>';
                }
            }
            , {field: 'address', width: 200, title: '地址', align: 'center'}
            , {field: 'openId', width: 260, title: '第三方账号', align: 'center'}
            , {field: 'status', width: 100, title: '状态', align: 'center', templet: '#statusTpl'}
            , {width: 180, title: '功能操作', align: 'center', toolbar: '#toolBar'}
        ];

        //【渲染TABLE】
        func.tableIns(cols, "tableList");
        //【设置弹框】
        func.setWin("注册会员",900, 320);
        //【设置状态】
        func.formSwitch('status', null, function (data, res) {

        });

    });
</script>
</body>
</html>